
<%= render :partial => 'tags/tagcloud' %> 
<div id="multiple_tag">
	<%= link_to_remote "multiple tag" , 
		:url => {:action => "set_multiple_tag" , :comtroller => "resources"},
		:update => "multi_tag" %>
		
		<%= link_to_remote "no multiple tag" , 
		:url => {:action => "no_multiple_tag" , :comtroller => "resources"},
		:update => "multi_tag" %>
	<div id="multi_tag">
		<% if !(session[:multiple_tags]).nil? then %> SET <% else %> NOT SET <% end %>
	</div>
</div>
	<h1><% if !(session[:multiple_tags]).nil? then %> Multi Tag<% end %>
		<% if @resourceType %> <%= @resourceType %> <%end%>
		 Resources 
		 <% if @user %> for  <%= @user.username %> <% end %> 
		 <% if @tag then %>tagged with: 
		 	<% if !(session[:multiple_tags]).nil? then %> 
		 		<% for tag_id in session[:multiple_tags] %>
		 			'<%= (Tag.find(tag_id)).name %>'
		 		<% end %>
		 		
		 	<% else %>
		 		'<%= @tag.name %>'
			 <% end %>
		 <% end %>
	</h1>

<%= link_to 'New resource', new_resource_path %>
<% for resource in @resources %>
<% @resource = resource %>

<a name="res_<%= resource.id.to_s %>"></a>
	<div id="res_<%= resource.id.to_s %>" class="resource">
		<span id="res_title"><%= link_to resource.title, resource.link, :popup=>true %></span>
			
		<%= resource.voting_interface %>
		<% if resource.isNewResource() then %> <%= image_tag("new-blink.gif") %> <% end %>
		<% if (resource.hasVideo() or resource.hasAudio()) then %> 
			<%= link_to image_tag("video-icon5.png", :title=>"Click to play"), resource %>
		<% end %>
		Added: <%= resource.created_at.to_formatted_s(:short) %>
		<p class="description">
		<b>Description: </b>
		<%= render :partial => 'generalTemplates/resource_html_index' %></p>

		
    	<%= link_to 'Show', resource %>
    	<%= render :partial => 'resources/edit_other_resources'  %>
		<div id="add_remove_fav_<%= resource.id.to_s %>">
    		<%= render :partial => 'generalTemplates/add_remove_favourites'  %>    	
		</div> 
		 
		
		 

		<!-- ADD COMMENT //-->
		<div id="comment_<%= resource.id.to_s %>">		
			<%= link_to_remote('Leave a comment', 
				:update=>"comment_"+resource.id.to_s, 
				:url=>{:controller=>"comments", :action=>"show_comment_input", :res_id=>resource.id},
				:success=>visual_effect(:slide_down, "comment_"+resource.id.to_s)
				) %>
		</div>
		<!-- READ COMMENTS //-->
		<div id="r_comment_<%= resource.id.to_s %>"  class="r_comments">		
			<u><%= link_to_remote('Read comments', 
				:update=>"r_comment_"+resource.id.to_s, 
				:url=>{:controller=>"comments", :action=>"show_comments_of", :res_id=>resource.id},
				:success=>visual_effect(:slide_down, "r_comment_"+resource.id.to_s)
				) %></u>
		</div> 
		there are <%= Comment.countComments(resource.id) %> comments
		<div id = "tags">
			<table>
    		<th>Tags:</th>
    		<% tags = resource.showResourceTags() %>
			<% for tag in tags %>
    		<td><%= link_to tag.name, :controller => "resources" , :action => "index" , :tag_id => tag.id %></td>
		<% end %>
		</table>
		</div> 
		
		<!--	<div id = "tags">
    			<b>Tags:</b>
    			<% tags = resource.showResourceTags() %>
				<% for tag in tags %>
    				<%= link_to_remote tag.name,
    					:url => {:controller => "resources" , :action => "filteredIndex" , :tag_id => tag.id },
    					:update => 'contents' ,
    					:with => " 'tags_list=' + $('tags_list').value +  #{tag.id}  " %> |
				<% end %>
			</div> -->
			<!--<%=h resource.user_id %>-->
	</div>


<% end %>

<br />


